<template>
    <div class="navbar">
        <el-container style="height: auto" direction="vertical">
            <el-header>
                <div class="headerdiv">
                    <div class="myheaddiv">
                        <div>
                            <div class="fl logo" style="padding-top: 10px;padding-left: 45px" >
                                <a href="/test2" class="fl hover logohover"></a>
                                <a href="/test2" class="wjxlogoText">问卷调查系统</a>
                            </div>
                        </div>
                        <div class="user-wrapper fr">
                            <div class="fl" style="height: 60px">
                                <dl class="my-question fl user-info headsplitline">
                                    <dt class="box user-info">
                                            <i class="el-icon-remove"></i>
                                            <span class="vam sm_text" @click="logout">注销</span>
                                    </dt>
                                </dl>
                                <div class="user-info fl">
                                </div>
                            </div>
                            <div class="fl" style="height: 60px">
                                <dl class="my-question fl user-info headsplitline">
                                    <dt class="box user-info">
                                        <a href="/test2">
                                            <i class="el-icon-s-home"></i>
                                            <span class="vam sm_text">我的问卷</span>
                                        </a>
                                    </dt>
                                </dl>
                                <div class="user-info fl">
                                </div>
                            </div>
                            <dl class="user-info useInfoWrap fl">
                                <dt class="user-icon">
                                    <img style="width:28px;height:28px;display:block" src="../assets/images/head.png"
                                         alt="">
                                </dt>
                                <dd class="spinner-list">
                                    <a href="" class="user-name">
                                        <span>{{username}}</span>
                                        <i class="index_iconfont fs14">▼</i>
                                    </a>
                                </dd>
                            </dl>
                        </div>
                    </div>
                </div>
            </el-header>
            <router-view></router-view>
            <el-footer class="footer">
                <div style="padding-top: 8px">
                    <a>
                        <i class="log-img">
                            <img src="../assets/images/logo-small.png"/>
                        </i>
                    </a>
                    <i class="log-dec">问卷调查</i>
                </div>
            </el-footer>
        </el-container>
    </div>
</template>

<script>
    import "@/assets/css/main.css";

    export default {
        name: "",
        data() {
            return {
                username: sessionStorage.getItem("username"),
            }
        },
        methods: {
            logout(){
                var r = confirm("确认注销？");
                if (r == true) {
                    sessionStorage.setItem("token", 'false');
                    sessionStorage.setItem("username", "");
                    sessionStorage.setItem("password","");
                    sessionStorage.setItem("id","");
                    this.$router.push("/login");
                } else {
                    return;
                }
            }
        }
    }
</script>

<style scoped lang="scss">


</style>
